//
//  CustomNavigationBar.swift
//  Kosspot
//
//  Created by 李鑫 on 2025/7/14.
//

import SwiftUI

struct CustomNavigationBar: View {
    @EnvironmentObject var appState: AppState
    let rightImageName: String?
    let title: String
    let rightItemAction: () -> Void
    
    var body: some View {
        HStack {
            Button(action: appState.navigateBack) {
                Image("back")
            }
            .frame(width: 16, height: 16)
            
            Spacer()
            
            Text(title)
                .font(.system(size: 18))
                .foregroundStyle(.white)
            
            Spacer()
            
            Button(action: rightItemAction) {
                Image(rightImageName ?? "")
            }
            .frame(width: 24, height: 24)
        }
        .padding(.horizontal,12)
        .frame(height: 44)
        .padding(.top,44)
    }
}

//#Preview {
//    CustomNavigationBar()
//}
